package com.ybkj.daijia.server.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ybkj.daijia.server.mc.Passenger;

/**
 * 客户所持优惠劵
 *
 * @author Shine
 */
public class Coupon extends Base {

    public static final int COUPON_STATUS_NOTBIND = 0;
    public static final int COUPON_STATUS_NOTUSE = 1;
    public static final int COUPON_STATUS_HASUSED = 2;
    public static final int COUPON_STATUS_INVALID = 3;
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @JsonIgnore
    private Long memberId;

    private Passenger passenger;

    private String phone;

    private Long couponRuleId;

    private CouponRule couponRule;

    @JsonIgnore
    private Long activityRecordId;

    @JsonIgnore
    private Integer status;//0未绑定 1未用(已绑定) 2已用  3失效

    private String code;

    private Long runCode;

    @JsonIgnore
    private String codeKey;

    /**
     * 线路id
     */
    private Long lineId;

    public Long getLineId() {
        return lineId;
    }

    public void setLineId(Long lineId) {
        this.lineId = lineId;
    }

    public Integer getStatus() {
        if (null == status) {
            return COUPON_STATUS_INVALID;
        }
        if (null == couponRuleId) {
            return COUPON_STATUS_INVALID;
        }
//		if(couponRule.isLapsed()){
//			return COUPON_STATUS_INVALID;
//		}
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCodeKey() {
        return codeKey;
    }

    public void setCodeKey(String codeKey) {
        this.codeKey = codeKey;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getCouponRuleId() {
        return couponRuleId;
    }

    public void setCouponRuleId(Long couponRuleId) {
        this.couponRuleId = couponRuleId;
    }

    public Long getActivityRecordId() {
        return activityRecordId;
    }

    public void setActivityRecordId(Long activityRecordId) {
        this.activityRecordId = activityRecordId;
    }

    public CouponRule getCouponRule() {
        return couponRule;
    }

    public void setCouponRule(CouponRule couponRule) {
        this.couponRule = couponRule;
    }

    public Long getRunCode() {
        return runCode;
    }

    public void setRunCode(Long runCode) {
        this.runCode = runCode;
    }

    public Passenger getPassenger() {
        return passenger;
    }

    public void setPassenger(Passenger passenger) {
        this.passenger = passenger;
    }


}
